package cn.ming.wfchat.app.moment.third.adapters;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import cn.ming.wfchat.R;
import cn.ming.wfchat.app.moment.third.beans.FriendCircleBean;
import cn.ming.wfchat.app.moment.third.interfaces.OnCommentLike;
import cn.ming.wfchat.app.moment.third.interfaces.OnCommentReply;
import cn.ming.wfchat.app.moment.third.interfaces.OnCommentUserClickListener;
import cn.ming.wfchat.app.moment.third.interfaces.OnFeedItemLongClickListener;
import cn.ming.wfchat.app.moment.third.interfaces.OnFeedUserClickListener;
import cn.ming.wfchat.app.moment.third.interfaces.OnTogglePraiseOrCommentPopupWindowListener;
import cn.ming.wfchat.app.moment.third.interfaces.OnTopTheMenu;
import cn.ming.wfchat.app.moment.third.widgets.NineGridView;
import cn.wildfirechat.remote.ChatManager;

class WordAndImagesViewHolder extends BaseFriendCircleViewHolder {

    NineGridView nineGridView;
    public ImageView img_click_menu;

    public WordAndImagesViewHolder(View itemView) {
        super(itemView);
        nineGridView = itemView.findViewById(R.id.nine_grid_view);
        img_click_menu = itemView.findViewById(R.id.img_click_menu);
    }

    @Override
    public void makeUserBaseData(BaseFriendCircleViewHolder holder, Context context, FriendCircleBean friendCircleBean, int position, boolean onlyPraise, boolean onlyComment, OnFeedItemLongClickListener onFeedItemLongClickListener, OnFeedUserClickListener onFeedUserClickListener, OnCommentUserClickListener onCommentUserClickListener, OnTogglePraiseOrCommentPopupWindowListener onTogglePraiseOrCommentPopupWindowListener, OnCommentLike onCommentLike, OnCommentReply onCommentReply, OnTopTheMenu onTopTheMenu) {
        super.makeUserBaseData(holder, context, friendCircleBean, position, onlyPraise, onlyComment, onFeedItemLongClickListener, onFeedUserClickListener, onCommentUserClickListener, onTogglePraiseOrCommentPopupWindowListener, onCommentLike, onCommentReply, onTopTheMenu);
        if (friendCircleBean.getUserBean().getUserId().equals(ChatManager.Instance().getUserId())) {
            img_click_menu.setVisibility(View.VISIBLE);
        } else {
            img_click_menu.setVisibility(View.GONE);
        }
        img_click_menu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (onTopTheMenu != null) {
                    onTopTheMenu.TopTheMenu(view, friendCircleBean, position);
                }
            }
        });

    }
}
